let processList = [
  {
    "process_id": 1,
    "name": "百度健康在线问诊20211129",
    "on_line_url": "https://m.miaoshou.com?id=1",
    "updated_at": "1625833202",
    "user_id": 1,
    "user_name": "miaoshou",
    "status": 1,
    "process_type": 1
  }
]
let processDetail = {
  'process_id1': {
    "process_id": 1,
    "process_name": "百度健康在线问诊20211129",
    "on_line_url": "https://m.miaoshou.com",
    "create_time": "1625833202",
    "update_time": "1625833202",
    "user_id": 1,
    "user_name": "miaoshou",
    "status": 1,
    "process": [{
      "process_type": 1,
      "process_data": {
        "consult": {
          "open_consult": 1,
          "directional_consult": 0,
          "no_directional_consult": 1,
          "no_directional_consult_data": {
            "speed_text_vip": 1,
            "dimethyl_hospital": 1,
            "top_three_hospital": 0
          }
        }
      }
    }, {
      "process_type": 2,
      "process_data": {
        "case_desc": 1,
        "case_data": 1
      }
    }, {
      "process_type": 3,
      "process_data": {
        "patient_name": 1,
        "patient_birth": 1,
        "patient_sex": 0,
        "patient_mobile": 1,
        "patient_idcard": 1,
        "patient_tag": 1
      }
    }]
  }
}



module.exports = [
  {
    url: '/consult-process/list',
    type: 'get',
    response: config => {
      const { page = 1, pagesize = 10 } = config.query
      const list = [...processList].reverse();
      const index = (page - 1) * pagesize;
      const howmany = pagesize
      const data = list.splice(index, howmany)
      return {
        code: 200,
        data: {
          list: data,
          totalcount: processList.length,
          currentpage: page,
          pagesize,
          totalpage: Math.ceil(processList.length / pagesize)
        }
      }
    }
  },

  {
    url: '/consult-process/detail',
    type: 'get',
    response: config => {
      const { process_id } = config.query
      const data = processDetail['process_id' + process_id]
      return {
        code: 200,
        data
      }
    }
  },
  {
    url: '/consult-process/create',
    type: 'post',
    response: config => {
      const { process_id } = config.body

      return {
        code: 200,
        data
      }
    }
  },




]
